package pro.softzhang.algo.lc1700;

import pro.softzhang.algo.flag.knowledge.KPrefixSum;

/**
 *
 */
public class LC1732_FindTheHighestAltitude {
    public static void main(String[] args) {

    }

    /**
     *
     */
    @KPrefixSum
    static
    class Solution {
        public int largestAltitude(int[] gain) {
            int largest = 0, altitude = 0;
            for(int i : gain) {
                altitude += i;
                largest = Math.max(largest, altitude);
            }
            return largest;
        }
    }
}
